var CameraLayer = {
	init:function(mapBoss){
		sbl.mergeObjects(this,BaseLayer,false);
		this.initLayer(mapBoss,"CameraLayer");
	},
	drawLayer:function(){
		var boss = this;
		var map = boss.map;
		var bound = map.getBounds();
		var miny = bound._swLat;
		var minx = bound._swLng;
		var maxy = bound._neLat;
		var maxx = bound._neLng;
		
		if(map.getZoom() < 18 || !boss.isOutOfView()){
			return;
		}
		
		boss.layerZoom = map.getZoom();
		boss.layerCenter = map.getCenter();
		
		boss.clearMarkers();
		boss.isVisible = true;
		
		sbl.ajax({
			dataType:'json',
			type:'get',
			data:{miny:miny,minx:minx,maxy:maxy,maxx:maxx},
			url:burl+"/Camera/getModelsForMap.do",
			success:function(d){
				var data = d.data;
				for(var j=0;j<data.length;j++){
					var row = data[j];
					var point = new BMap.Point(row.LON,row.LAT);
					var icon = new BMap.Icon(burl+"/images/camera/camera.png", new BMap.Size(18,20));
					
					var Marker = new BMap.Marker(point);
					Marker.data = row;						
					Marker.addEventListener("click",function(){

					});
					Marker.setIcon(icon);
					boss.layerMarkers.push(Marker);
					map.addOverlay(Marker);
				}
			}
		});
	}
}